<template>
	<div class="job">
		<div class="jobcon">
			<el-form ref="form" :model="form" class='elform' label-width="80px">
				<el-form-item label="公司姓名">
					<el-col :span='11'>
						<el-input v-model="form.name"></el-input>
					</el-col>
				</el-form-item>

				<el-form-item label="所属行业">
					<el-col :span="11" >
						<el-select v-model="form.region" placeholder="请选择">
							<el-option label="初中" value="初中"></el-option>
							<el-option label="高中" value="高中"></el-option>
							<el-option label="中专" value="中专"></el-option>
							<el-option label="大专" value="大专"></el-option>
							<el-option label="本科" value="本科"></el-option>
							<el-option label="研究生" value="研究生"></el-option>
							<el-option label="硕士" value="硕士"></el-option>
						</el-select>
					</el-col>
				</el-form-item>
				<el-form-item label="所在地">
					<el-col :span='11'>
						<div class="block">
							<el-cascader :options="form.city" v-model="form.selectedCity" style="width: 100%;" @change="handleChange">
							</el-cascader>
						</div>
					</el-col>
				</el-form-item>
				
				<el-form-item label="联系人">
					<el-col :span='11'>
						<el-input v-model="form.name"></el-input>
					</el-col>
				</el-form-item>
				<el-form-item label="手机号码">
					<el-col :span='11'>
						<el-input v-model="form.tel" @blur='telyan'></el-input>
					</el-col>
				</el-form-item>
				<el-form-item label="公司固话">
					<el-col :span='11'>
						<el-input v-model="form.name" placeholder="请填写完整固话加区号和分机号"></el-input>
					</el-col>
				</el-form-item>
				<el-form-item label="公司邮箱">
					<el-col :span='11'>
						<el-input v-model="form.name"></el-input>
					</el-col>
				</el-form-item>
				<el-form-item label="用工岗位">
					<el-col :span='11'>
						<el-input v-model="form.yggw"></el-input>
					</el-col>
				</el-form-item>
				<el-form-item label="用工描述">
					<el-col :span='22'>
						<el-input type="textarea" v-model="form.ygms"></el-input>
					</el-col>
				</el-form-item>
				<div style="text-align: center;">
					<el-button type="primary" @click="onSubmit()">提交</el-button>
				</div>
			</el-form>
		</div>
	</div>
</template>
<script type="text/javascript">
	import { city ,shengshixian } from "@/assets/js/city";
	export default {
		data() {
			return {
				form: {
					name: '',
					region: '',
					tel:'',
					city:city,
					date1: '',
					date2: '',
					delivery: false,
					type: [],
					resource: '',
					desc: '',
					selectedCity:[],
					yggw:'',
					ysms:'',
					
				}
			}
		},
		methods: {
			onSubmit() {				
				console.log(this.$store.state.count);
				this.$message({
					showClose: true,
					message: '提交成功',
					type: 'success'
				});
				this.$emit('closeuse','close');
			},
			handleChange() {
				let selec = this.form.selectedCity;
				let objssx = shengshixian(selec);
				console.log(objssx);
			},
			telyan(e){
				let tel = e.srcElement.value.trim();
				let reg = /^1[3|4|5|8][0-9]\d{4,8}$/
				if(!reg.test(tel)) {
					this.$notify.error({
						title: '错误',
						message: '你输入的手机号不合法'
					});
				}
			},
		}
	}
</script>
<style lang="scss" scoped>
	.job {
		position: absolute;
		width: 100%;
		left: 0%;
		right: 0%;
		top: 40px;
		bottom: 20px;
		background-color: white;
		.jobcon {
			width: 100%;
			height: 100%;
			background-color: white;
			overflow: auto;
			.tijiao {
				text-align: center;
			}
		}
	
		.elform {
			position: absolute;
			top: 16px;
			left: 20px;
			right: 0px;
			bottom: 10px;
			overflow: auto;
			p {
				margin-bottom: 10px;
				img {
					width: 18px;
					margin-top: 10px;
					display: inline-block;
					margin-right: 10px;
				}
				span {
					line-height: 30px;
					font-size: 17px;
				}
			}
		}
	}
</style>